package com.candy.service.impl;

import com.candy.bean.UserInfo;
import com.candy.dao.UserInfoMapper;
import com.candy.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    UserInfoMapper userInfoMapper;
    /**
     * 登录方法，
     * @return 返回true则表示用户名  密码匹配成功 范湖fasle；匹配失败
     */
    @Override
    public boolean logined(UserInfo userInfo) {
       List<UserInfo> userInfos= userInfoMapper.selectByParam(userInfo);
       if(userInfos!=null&&userInfos.size()>0){
           return true;
       }else {
           return false;
       }

    }
}
